<?php
/*
	插件概览
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
if($_RQ['op']=='get'){
	if($_SESSION['juese_id']!=6){
		exi('您无权访问！','error');
	}
	//显示统计数据
	$daytime = mktime(0,0,0,date('m'),date('d'),date('Y'));
	$member_from1_type=$this->member_from1_type;
	foreach($member_from1_type as $key=>$title){
		$from1['num'.$key]=pdo_count('jy_yxw_member',array('from_type'=>1,'from1_type'=>$key,'worker'.$_SESSION['juese_id'].'id'=>$_SESSION['workerid'],'storeid'=>$_SESSION['storeid'],'uniacid'=>$_SESSION['uniacid'],'status between'=>array(10,20)));
		$from1['all'.$key]=pdo_count('jy_yxw_member',array('from_type'=>1,'from1_type'=>$key,'worker'.$_SESSION['juese_id'].'id'=>$_SESSION['workerid'],'storeid'=>$_SESSION['storeid'],'uniacid'=>$_SESSION['uniacid']));
		if($from1['all'.$key]){
			$from1['rate'.$key]=$from1['num'.$key]*100/$from1['all'.$key];
		}else{
			$from1['rate'.$key]=0;
		}
	}
	$member_from2_type=$this->member_from2_type;
	foreach($member_from2_type as $key=>$title){
		$from2['num'.$key]=pdo_count('jy_yxw_member',array('from_type'=>2,'from2_type'=>$key,'worker'.$_SESSION['juese_id'].'id'=>$_SESSION['workerid'],'storeid'=>$_SESSION['storeid'],'uniacid'=>$_SESSION['uniacid'],'status between'=>array(10,20)));
		$from2['all'.$key]=pdo_count('jy_yxw_member',array('from_type'=>2,'from2_type'=>$key,'worker'.$_SESSION['juese_id'].'id'=>$_SESSION['workerid'],'storeid'=>$_SESSION['storeid'],'uniacid'=>$_SESSION['uniacid']));
		if($from2['all'.$key]){
			$from2['rate'.$key]=$from2['num'.$key]*100/$from2['all'.$key];
		}else{
			$from2['rate'.$key]=0;
		}
	}
	$htmls=array(
		array('type'=>'data','num'=>12,'one_num'=>3,'title'=>'实体成交数量/转化率','datas'=>array(
			array('title'=>'58下载','num'=>2,'data'=>array($from1['num1'],price($from1['rate1']).'%')),
			array('title'=>'58主投','num'=>2,'data'=>array($from1['num2'],price($from1['rate2']).'%')),
			array('title'=>'前程','num'=>2,'data'=>array($from1['num3'],price($from1['rate3']).'%')),
			array('title'=>'智联','num'=>2,'data'=>array($from1['num4'],price($from1['rate4']).'%')),
			array('title'=>'boss','num'=>2,'data'=>array($from1['num5'],price($from1['rate5']).'%')),
			array('title'=>'口碑','num'=>2,'data'=>array($from1['num6'],price($from1['rate6']).'%')),
			array('title'=>'直上','num'=>2,'data'=>array($from1['num7'],price($from1['rate7']).'%')),
			array('title'=>'其它','num'=>2,'data'=>array($from1['num8'],price($from1['rate8']).'%')),
		)),
		array('type'=>'data','num'=>12,'one_num'=>3,'title'=>'网络成交数量/转化率','datas'=>array(
			array('title'=>'百度','num'=>2,'data'=>array($from2['num1'],price($from2['rate1']).'%')),
			array('title'=>'360','num'=>2,'data'=>array($from2['num2'],price($from2['rate2']).'%')),
			array('title'=>'搜狗','num'=>2,'data'=>array($from2['num3'],price($from2['rate3']).'%')),
			array('title'=>'抖音','num'=>2,'data'=>array($from2['num4'],price($from2['rate4']).'%')),
			array('title'=>'小红书','num'=>2,'data'=>array($from2['num5'],price($from2['rate5']).'%')),
			array('title'=>'微信','num'=>2,'data'=>array($from2['num6'],price($from2['rate6']).'%')),
			array('title'=>'其它','num'=>2,'data'=>array($from2['num7'],price($from2['rate7']).'%')),
		)),
	);
	$return['htmls']=$htmls;
	exi($return);
}